<template>
	<view id="bind-account-page">
		<view class="row-list">
			<view class="row-cell" @tap="toTbAccountPage">
				<view class="row-cell-icon  el-icon-ali-tb tb-color"></view>
				<view class="row-cell-title">淘宝</view>
				<view class="row-cell-right-icon">	<uni-icons class="row-icon" type="arrowright" color="#888" size="16"></uni-icons></view>
			</view>
			<view class="row-cell" @tap="toJdAccountPage">
				<view class="row-cell-icon el-icon-ali-jd jd-color"></view>
				<view class="row-cell-title">京东</view>
				<view class="row-cell-right-icon">	<uni-icons class="row-icon" type="arrowright" color="#888" size="16"></uni-icons></view>
			</view>
			<view class="row-cell" @tap="toPddAccountPage">
				<view class="row-cell-icon el-icon-ali-pdd pdd-color"></view>
				<view class="row-cell-title">拼多多</view>
				<view class="row-cell-right-icon">	<uni-icons class="row-icon" type="arrowright" color="#888" size="16"></uni-icons></view>
			</view>
			<view class="row-cell" @tap="toWphAccountPage">
				<view class="row-cell-icon el-icon-ali-wph wph-color"></view>
				<view class="row-cell-title">唯品会</view>
				<view class="row-cell-right-icon">	<uni-icons class="row-icon" type="arrowright" color="#888" size="16"></uni-icons></view>
			</view>
            <view class="row-cell" @tap="toTiktokAccountPage">
                <view class="row-cell-icon iconfont2 icon-douyin2"></view>
                <view class="row-cell-title">抖音</view>
                <view class="row-cell-right-icon">	<uni-icons class="row-icon" type="arrowright" color="#888" size="16"></uni-icons></view>
            </view>
            <!--<view class="row-cell" @tap="toXhsAccountPage">-->
            <!--    <view class="row-cell-icon el-icon-ali-wph wph-color"></view>-->
            <!--    <view class="row-cell-title">小红书</view>-->
            <!--    <view class="row-cell-right-icon">-->
            <!--        <uni-icons class="row-icon" type="arrowright" color="#888" size="16"/>-->
            <!--    </view>-->
            <!--</view>-->
		</view>
	</view>
</template>

<script>
	import {
		apiPushUser
	} from '../../../http/apis.js'
	import {
		mapState
	} from 'vuex'
	export default {
		computed: {
			...mapState(['token'])
		},
		data(){
			return{
				userInfo: {},
			}
		},
		onLoad() {

		},
		onShow() {
			this.getUserInfo()
		},
		methods:{
			getUserInfo(){
				apiPushUser({
					token: this.token
				}).then(res =>{
				    if(res.data.code == 1)  {
						this.userInfo = res.data.msg
					}
				}).catch(res => {
					this.$msg.showToast(res.data.msg)
				})
			},
			toTbAccountPage(){
				if (this.userInfo.tb_status == 5 || this.userInfo.tb_status == 6){
					uni.navigateTo({
						url: '../bindInfo/bindTbAccountxl?type=again'
					})
				} else {
					uni.navigateTo({
						url: './tbAccount?type=1'
					});
				}
			},
			toJdAccountPage(){
				if(this.userInfo.id_card_status ==4){
					this.$msg.showToast('请先绑定身份证信息')
					setTimeout(()=>{
						uni.navigateTo({
							url: '../bindInfo/bindInfo'
						})
					},1000)
					return
				}
				if(this.userInfo.jd_status == 1){
					uni.navigateTo({
						url: './tbAccount?type=3'
					});
					return
				}
				if (this.userInfo.jd_status == 2) {
					uni.navigateTo({
						url: './jdAccount'
					})
					return
				}
				if(this.userInfo.jd_status == 3){
					this.$msg.showToast('审核中')
					return
				}
			},
			toPddAccountPage (){
				if(this.userInfo.id_card_status ==4){
					this.$msg.showToast('请先绑定身份证信息')
					setTimeout(()=>{
						uni.navigateTo({
							url: '../bindInfo/bindInfo'
						})
					},1000)
					return
				}
				if(this.userInfo.pdd_status == 1){
					uni.navigateTo({
						url: './tbAccount?type=15'
					});
					return
				}
				if (this.userInfo.pdd_status == 2) {
					uni.navigateTo({
						url: './pddAccount'
					})
					return
				}
				if(this.userInfo.pdd_status == 3){
					this.$msg.showToast('审核中')
					return
				}
			},
			toWphAccountPage (){
				if(this.userInfo.id_card_status ==4){
					this.$msg.showToast('请先绑定身份证信息')
					setTimeout(()=>{
						uni.navigateTo({
							url: '../bindInfo/bindInfo'
						})
					},1000)
					return
				}
				if(this.userInfo.wph_status == 1){
					uni.navigateTo({
						url: './tbAccount?type=13'
					});
					return
				}
				if (this.userInfo.wph_status == 2) {
					uni.navigateTo({
						url:'./wphAccount'
					})
					return
				}
				if(this.userInfo.wph_status == 3){
					this.$msg.showToast('审核中')
					return
				}
			},
            toTiktokAccountPage(){
                if(this.userInfo.tiktok_status == 1){
                  uni.navigateTo({
                    url: './tbAccount?type=20'
                  });
                  return
                }
                if (this.userInfo.tiktok_status == 2) {
                  uni.navigateTo({
                    url: './tiktokAccount'
                  })
                  return
                }
                if(this.userInfo.tiktok_status == 3){
                  this.$msg.showToast('审核中')
                  return
                }
            },

            toXhsAccountPage (){
                if(this.userInfo.id_card_status ==4){
                    this.$msg.showToast('请先绑定身份证信息')
                    setTimeout(()=>{
                        uni.navigateTo({
                            url: '../bindInfo/bindInfo'
                        })
                    },1000)
                    return
                }
                if(this.userInfo.xhs_status == 1){
                    uni.navigateTo({
                        url: './tbAccount?type=21'
                    });
                    return
                }
                if (this.userInfo.xhs_status == 2) {
                    // console.log(this.userInfo.xhs_status)
                    uni.navigateTo({
                        url:'./xhsAccount'
                    })
                    return
                }
                if(this.userInfo.xhs_status == 3){
                    this.$msg.showToast('审核中')
                    return
                }
            },
        }
	}
</script>

<style lang="scss">
	#bind-account-page {
		.row-list {
			background: #FFFFFF;
			box-shadow: 0px 0px 10upx 0px rgba(0, 0, 0, 0.1);
			border-radius: 20upx;
			margin: 32upx 32upx;
			.row-cell {
				position: relative;
				border-bottom: 1px solid #F8F8F8;
				padding: 0 24upx 0 38upx;
				height: 106upx;
				line-height: 106upx;
				.row-cell-icon {
					display: inline-block;
					font-size: 40upx;
					margin-right: 20upx;
					line-height: 106upx;
					&.tb-color {
						color: rgb(253,60,13);
					}
					&.jd-color {
						color: rgb(230,67,65);
					}
					&.wph-color{
						color: rgb(220,19,116);
					}
					&.pdd-color {
						color: rgba(232,40,29);
					}
				}
				.row-cell-title {
					display: inline-block;
					font-size: $font-base;
					vertical-align: top;
					color: #333333;
					font-size: 30upx;
				}
				.row-cell-right-icon {
					display: inline-block;
					position: absolute;
					right: 20upx;
				}
			}
		}
	}
</style>
